import store from '@/store'

export const hasPermission = permissionRoles => {
  const roles = store.getters && store.getters.roles
  if (permissionRoles && permissionRoles instanceof Array && permissionRoles.length > 0) {
    return roles.some(role => permissionRoles.includes(role))
  }
  return true
}
